<?php
/*
 *  Rock Band Stats(C) 2008  Tea Figuric
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 *  Tea Figuric
 *  tea@figuric.net
 *  http://www.figuric.net/luc/facebook/rockband/xml/
 */

require_once 'appinclude.php';
$name = $_GET['name'];

if($name == "")
$facebook->redirect($appstandardurl);

$arrname = explode("_", $name);
$propername = implode(" ", $arrname);

// now read the XML file
$xml = simplexml_load_file('./xml/' . $name . '.xml');

echo '<link rel="stylesheet" href="rockbandstyle.css" type="text/css" media="all"/>
<div style="padding:20px;">
<div class="nav"><span class="nav"><a href="profile.php?name=' . $name .'">My Stats  </a> | <a href="index.php">New Band  </a>|<a href="index.php"> Some other link </a></span><br />
  <br />

<div style="border-top: 1px solid #d8dfea; border-bottom: 1px solid #d8dfea; padding: 10px 20px; background: #f7f7f7 none repeat scroll 0% 0%; border-left: 1px solid #d8dfea; border-right: 1px solid #d8dfea; width: auto;">
  <h3>Your Current Stats</h3></div>
</div>

<div class="style1" style="padding: 10px 5px 10px 10px; float: left;">Your profile currently displays the following game stats: <br />
<p>';
echo $xml->leader . '<br>';
echo $xml->motto . '<br>';
echo $xml->hometown  . '<br>';
echo $xml->fans  . '<br>';
echo $xml->score  . '<br>';
echo $xml->founded  . '<br></p></div></div>';

// the profile box contents
$fbml = <<<EndHereDoc
<fb:subtitle>
<a href="http://apps.facebook.com/rockbandstats/profile.php?name=$name" >My Stats </a>|
<a href="http://apps.facebook.com/rockbandstats/">Rock Band Stats</a></fb:subtitle>
<fb:wide>
<div class="inside_the_box wide clearfix app_content" id="app_content">
<div>
<div style="padding-left: 0px; font: 12px Arial; color: #FFFFFF">

<table width="343px" height="305" border="0" background="http://www.figuric.net/luc/facebook/rockband/bfwide.gif">
  <tr>
    <td height="29">&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td width="103">&nbsp;</td>
    <td width="237"><font size="3">Stats for my Band</font></td>
  </tr>
	<tr>
    <td>&nbsp;</td>
    <td><font size="3"><strong>$propername</strong></font></td>
	</tr>
  <tr>
    <td>&nbsp;</td>
    <td>Band  Leader:  $xml->leader </td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>Band Motto: $xml->motto </td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>Home Town: $xml->hometown </td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>Fans: $xml->fans </td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>Score:  $xml->score </td>
  </tr>
  <tr>
    <td height="21">&nbsp;</td>
    <td>Founded: $xml->founded </td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>
</div>


</div>
</div>
</fb:wide>


<fb:narrow>
<div class="inside_the_box wide clearfix app_content" id="app_content">
<div>
<div style="padding-left: 0px; font: 10px Arial; color: #FFFFFF">

<table width="192px" height="305px" border="0" background="http://www.figuric.net/luc/facebook/rockband/bfnarrow.gif">
  <tr>
    <td height="45px">&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td width="103">&nbsp;</td>
    <td width="237">Stats for my Band</td>
  </tr>
	<tr>
    <td>&nbsp;</td>
    <td><strong>$propername</strong></td>
	</tr>
  <tr>
    <td>&nbsp;</td>
    <td>Band  Leader:  $xml->leader </td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>Band Motto: $xml->motto </td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>Home Town: $xml->hometown </td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>Fans: $xml->fans </td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>Score:  $xml->score </td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>Founded: $xml->founded </td>
  </tr>
  <tr>
    <td height="45px">&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>
</div>
</div>
</div>
</fb:narrow>
EndHereDoc;


$facebook->api_client->profile_setFBML($fbml, $user);


?>